#pragma once
#include "libutilsbase.h"
#include "shared_ptr.h"

class TiXmlDocument;
class TiXmlNode;

LIB_NS_BEGIN

class LIBAPI TConfigSetting
{
public:

	bool LoadConfig(const char* fname);
	bool LoadConfig(const wchar_t* fname);

	bool Save(const TCHAR* fname = NULL);	
	
	virtual ~TConfigSetting(void);
	TiXmlNode& operator [] (const char*  key);
	TiXmlNode& AppSetting();

	TConfigSetting();
private:
#pragma warning(disable : 4251)
	tstring m_fname;
	shared_ptr<TiXmlDocument> m_doc;

};

LIB_NS_END